package com.bit.book.Controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/test")
@RestController
public class TestController {

    @RequestMapping("/t1")
    public Integer t1(){
        int a = 10/0;  // 除数为 0 异常
        return 1;
    }

    @RequestMapping("/t2")
    public boolean t2(){
        int[] arr = {1, 2, 3};
        System.out.println(arr[4]);  // 数组越界异常
        return true;
    }

    @RequestMapping("/t3")
    public String t3(){
        String a = null;
        System.out.println(a.length());  // 空指针异常
        return "t3";
    }
}
